import request from '@/utils/request'


export function getDeptPages(data) {
  return request({
    url: '/sys-dept',
    method: 'get',
    params: data
  })
}

export function addDept(data) {
  return request({
    url: '/sys-dept',
    method: 'post',
    data
  })
}


export function updateDept(id, data) {
  return request({
    url: `/sys-dept/${id}`,
    method: 'put',
    data
  })
}

export function deleteDept(id) {
  return request({
    url: `/sys-dept/${id}`,
    method: 'delete'
  })
}

export function deptTree() {
  return request({
    url: `/sys-dept/tree`,
    method: 'get'
  })
}